package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.LevelMapper;
import com.jsb.model.Level;
import com.jsb.model.LevelExample;

@Service
public class LevelService{
	
	@Resource
	private LevelMapper levelMapper;
	
	public void addLevel(Level level) {
		levelMapper.insertSelective(level);
	}
	
	public void delLevelByUuid(String uuid) {
		levelMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateLevel(Level level) {
		levelMapper.updateByPrimaryKeySelective(level);
	}
	
	public void updateLevelByExample(Level level,LevelExample levelExample){
	    levelMapper.updateByExampleSelective(level,levelExample);
	}
	
	public Level getLevelByUuid(String uuid) {
		return levelMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Level> getPageLevel(LevelExample levelExample) {
		return levelMapper.selectPage(levelExample);
	}
	
	public int countLevel(LevelExample levelExample) {
		return levelMapper.countByExample(levelExample);
	}
	
	public List<Level> selectByExample(LevelExample example){
	    return levelMapper.selectByExample(example);
	}
}
